package com.ash.socketa.simple;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

public class ClientSimpleDemo {

    public static void main(String[] args) throws IOException {
        try (Socket localhost = new Socket("localhost", 8081);
             OutputStream outputStream = localhost.getOutputStream();) {

            outputStream.write("我是一个请求".getBytes(StandardCharsets.UTF_8));
        }
    }
}
